package com.esm.sm800.util;

import java.util.HashMap;
import java.util.Map;

import zuo.biao.library.interfaces.OnHttpResponseListener;
import zuo.biao.library.manager.HttpManager;

public class HttpRequest {

    public static String url_pre = "http://" + "192.168.0.121:8083";
    /*
     * http://192.168.0.121:8083/api/fas/login?username=wangwu&password=123456
     */
    public static void login(String username, String password, String token, final int requestCode, final OnHttpResponseListener listener) {
        Map<String, Object> request = new HashMap<>();
        request.put("username", username);
        request.put("password", password);
        request.put("fcmtoken", token);
        HttpManager.getInstance().post(request, url_pre + "/api/fas/login", requestCode, listener);
    }

    /*
     * http://192.168.0.121:8083/api/fas/zcgrouplist
     */
    public static void zcgrouplist(final int requestCode, final OnHttpResponseListener listener) {
        Map<String, Object> request = new HashMap<>();
        HttpManager.getInstance().post(request, "http://192.168.0.121:8083/api/fas/zcgrouplist", requestCode, listener);
    }

    /*
     * http://192.168.0.121:8083/api/fas/gdanlist?adminid=22&state=0&type=0
     */
    public static void gdanlist(int adminid, int state, int type, final int requestCode, final OnHttpResponseListener listener) {
        Map<String, Object> request = new HashMap<>();
        request.put("adminid", adminid);
        request.put("state", state);
        request.put("type", type);
        HttpManager.getInstance().post(request, "http://192.168.0.121:8083/api/fas/gdanlist", requestCode, listener);
    }

    /*
     * http://192.168.0.121:8083/api/fas/zclist?adminid=18&state=0
     */
    public static void zclist(int adminid, int state, final int requestCode, final OnHttpResponseListener listener) {
        Map<String, Object> request = new HashMap<>();
        request.put("adminid", adminid);
        request.put("state", state);
        HttpManager.getInstance().post(request, "http://192.168.0.121:8083/api/fas/zclist", requestCode, listener);
    }

    /*
     * http://192.168.0.121:8083/api/fas/gddetailinfo
     */
    public static void gddetailinfo(long gd_id, final int requestCode, final OnHttpResponseListener listener) {
        Map<String, Object> request = new HashMap<>();
        request.put("id", gd_id);
        HttpManager.getInstance().post(request, "http://192.168.0.121:8083/api/fas/gddetailinfo", requestCode, listener);
    }

    /*
     * http://192.168.0.121:8083/api/fas/getsms?adminid=22
     */
    public static void getsms(int adminid, final int requestCode, final OnHttpResponseListener listener) {
        Map<String, Object> request = new HashMap<>();
        request.put("adminid", adminid);
        HttpManager.getInstance().post(request, "http://192.168.0.121:8083/api/fas/getsms", requestCode, listener);
    }

}